import 'package:flutter/material.dart';
import 'package:flutter_bilibili/util/business_util.dart';
import 'package:flutter_bilibili/widget/primary_button.dart';

class WelcomePage extends StatefulWidget {
  const WelcomePage({super.key});

  @override
  State<WelcomePage> createState() => _WelcomePageState();
}

class _WelcomePageState extends State<WelcomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('欢迎进入flutter_bilibili！')),
      body: Container(
        width: MediaQuery.of(context).size.width,
        decoration: const BoxDecoration(
          image: DecorationImage(
            image: AssetImage('images/b.jpg'),
            fit: BoxFit.cover,
          ),
        ),
        child: const Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            SizedBox(
              width: 100,
              child: PrimaryButton('login', onPressed: toLoginPage),
            ),
            SizedBox(
              height: 20,
            ),
            SizedBox(
              width: 100,
              child: PrimaryButton('register', onPressed: toRegisterPage),
            ),
          ],
        ),
      ),
    );
  }
}
